Optimal. Leaf size=37 \[ \frac {1}{2} \cos (2 a) \text {Ci}\left (\frac {2 b}{x}\right )-\frac {1}{2} \sin (2 a) \text {Si}\left (\frac {2 b}{x}\right )+\frac {\log (x)}{2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3425, 3378, 3376, 3375} \[ \frac {1}{2} \cos (2 a) \text {CosIntegral}\left (\frac {2 b}{x}\right )-\frac {1}{2} \sin (2 a) \text {Si}\left (\frac {2 b}{x}\right )+\frac {\log (x)}{2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3375
Rule 3376
Rule 3378
Rule 3425
Rubi steps
\begin {align*} \int \frac {\sin ^2\left (a+\frac {b}{x}\right )}{x} \, dx &=\int \left (\frac {1}{2 x}-\frac {\cos \left (2 a+\frac {2 b}{x}\right )}{2 x}\right ) \, dx\\ &=\frac {\log (x)}{2}-\frac {1}{2} \int \frac {\cos \left (2 a+\frac {2 b}{x}\right )}{x} \, dx\\ &=\frac {\log (x)}{2}-\frac {1}{2} \cos (2 a) \int \frac {\cos \left (\frac {2 b}{x}\right )}{x} \, dx+\frac {1}{2} \sin (2 a) \int \frac {\sin \left (\frac {2 b}{x}\right )}{x} \, dx\\ &=\frac {1}{2} \cos (2 a) \text {Ci}\left (\frac {2 b}{x}\right )+\frac {\log (x)}{2}-\frac {1}{2} \sin (2 a) \text {Si}\left (\frac {2 b}{x}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.06, size = 32, normalized size = 0.86 \[ \frac {1}{2} \left (\cos (2 a) \text {Ci}\left (\frac {2 b}{x}\right )-\sin (2 a) \text {Si}\left (\frac {2 b}{x}\right )+\log (x)\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.63, size = 39, normalized size = 1.05 \[ \frac {1}{4} \, {\left (\operatorname {Ci}\left (\frac {2 \, b}{x}\right ) + \operatorname {Ci}\left (-\frac {2 \, b}{x}\right )\right )} \cos \left (2 \, a\right ) - \frac {1}{2} \, \sin \left (2 \, a\right ) \operatorname {Si}\left (\frac {2 \, b}{x}\right ) + \frac {1}{2} \, \log \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.56, size = 65, normalized size = 1.76 \[ \frac {b \cos \left (2 \, a\right ) \operatorname {Ci}\left (-2 \, a + \frac {2 \, {\left (a x + b\right )}}{x}\right ) + b \sin \left (2 \, a\right ) \operatorname {Si}\left (2 \, a - \frac {2 \, {\left (a x + b\right )}}{x}\right ) - b \log \left (-a + \frac {a x + b}{x}\right )}{2 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.04, size = 36, normalized size = 0.97 \[ -\frac {\ln \left (\frac {b}{x}\right )}{2}-\frac {\Si \left (\frac {2 b}{x}\right ) \sin \left (2 a \right )}{2}+\frac {\Ci \left (\frac {2 b}{x}\right ) \cos \left (2 a \right )}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [C] time = 0.43, size = 51, normalized size = 1.38 \[ \frac {1}{4} \, {\left ({\rm Ei}\left (\frac {2 i \, b}{x}\right ) + {\rm Ei}\left (-\frac {2 i \, b}{x}\right )\right )} \cos \left (2 \, a\right ) + \frac {1}{4} \, {\left (i \, {\rm Ei}\left (\frac {2 i \, b}{x}\right ) - i \, {\rm Ei}\left (-\frac {2 i \, b}{x}\right )\right )} \sin \left (2 \, a\right ) + \frac {1}{2} \, \log \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.03 \[ \int \frac {{\sin \left (a+\frac {b}{x}\right )}^2}{x} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 2.66, size = 31, normalized size = 0.84 \[ \frac {\log {\relax (x )}}{2} - \frac {\sin {\left (2 a \right )} \operatorname {Si}{\left (\frac {2 b}{x} \right )}}{2} + \frac {\cos {\left (2 a \right )} \operatorname {Ci}{\left (\frac {2 b}{x} \right )}}{2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________